# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pyqt3
pkgver=3.18.1
pkgrel=3
pkgdesc='A set of Python bindings for the Qt3 toolkit.'
arch=('x86_64' 'aarch64')
url='http://www.riverbankcomputing.com/software/pyqt/intro'
depends=('python2-sip' 'qscintilla-qt3')
license=('GPL')
source=("http://downloads.sourceforge.net/project/pyqt/PyQt3/PyQt-x11-gpl-$pkgver.tar.gz"
        'sip415_fix.patch')
sha512sums=('a0d441d3b151c59129f734223e5b2ab6e4c55262f7a99309b9cf48ee27d8ec3c7758359d419b11a29b71dd3c3ea3090215589d38ba467d19b75c87321fc4f4d9'
            'ecddba3610963a2bf67c111060615459b63150b9a6117de3f0586421e333b6477d7952e9dc2e810c6e3288d41d45db319a78c57f743f3e5fbb7624ce596495cb')

_dir="PyQt-x11-gpl-$pkgver"

prepare() {
  cd $_dir

  patch -p0 -i '../sip415_fix.patch'
}

build() {
  cd $_dir

  export QTDIR=/usr
  export QMAKESPEC=/usr/share/qt3/mkspecs/linux-g++

  echo yes | python2 configure.py -b /usr/bin \
    -d /usr/lib/python2.7/site-packages -v /usr/share/sip \
    INCDIR_QT=/usr/include/qt3

  make CXX="g++ -DANY=void"
}

package() {
  cd $_dir

  make DESTDIR="$pkgdir" install
}

